-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tdx-verifier: eventlog: handle OVMF/efistub measurements correctly #674
base: main
Are you sure you want to change the base?
Conversation
e5aa1d6
to
d790cc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert here but this seems ok. Made a couple comments about the style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
We probably want to give @Xynnn007 a chance to look at this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Only some nits.
The original "TDVF" kernel parser is not able to find the kernel measurement from the raw eventlog. Futhermore, it never implemented cmdline/initrd parsers similar to be aligned with the TdShim functionality. CoCo TDX uses Qemu direct boot. OVMF loads the kernel using GenericQemuLoadImageLib and it is located under a vendor media device path. This path also is found in the measured event desciption so look for that as the anchor to the kernel measurement digest. The kernel first runs the Linux efistub. Starting Linux 6.9, it adds the support for CC_MEASUREMENT_PROTOCOL which is used to extend RTMRs for cmdline (load image parameters) and initrd measurements. These are logged using EV_EVENT_TAG with the event description (and ID) identifying the measurement. Signed-off-by: Mikko Ylinen <[email protected]>
Add tests to cover the Tdvf* MeasuredEntity enums. It also requires an updated CCEL raw blob which is originated from Kata 3.13.0 based boot with the initrd set as the rootfs. Signed-off-by: Mikko Ylinen <[email protected]>
Add all of the Tdvf* MeasuredEntity results to the TDX claims under ccel. Signed-off-by: Mikko Ylinen <[email protected]>
This PR is a stopgap for checking the OVMF/direct boot based measurements logged in the CCEL. It merely follows the original
MeasuredEntity
approach for finding the kernel/cmdline/initrd measurements from the logs.We should look to improve this and make it more generic to allow policies to check for more of the events and to support for different boot flows as well.